package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author maxingjian
 * @since 2019-11-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tt_menu_favorite")
public class MenuFavoritePO extends DMSBasePO<MenuFavoritePO> {

    private static final long serialVersionUID = 1L;

    /**
     * 收藏菜单ID
     */
    @TableId(value = "FAVORITE_ID", type = IdType.AUTO)
    private Long favoriteId;

    /**
     * 经销商代码
     */
    @TableField("COMPANY_ID")
    private Long companyId;

    @TableField("APP_ID")
    private String appId;

    /**
     * 菜单ID
     */
    @TableField("MENU_ID")
    private Long menuId;

    /**
     * 员工账号
     */
    @TableField("USER_CODE")
    private String userCode;

    @TableField("USER_ORG_ID")
    private Long userOrgId;

    /**
     * 是否收藏 使用代码1004
     */
    @TableField("FAVORITE")
    private Long favorite;

    @Override
    protected Serializable pkVal() {
        return null;
    }

    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author maxingjian
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "${keyPropertyName}");
    }

}
